/**
 * zmn文章模块-文章编辑
 * 文件命名格式：zmn.模块.表/功能.jas
 * @author duanzuocai
 * @since 2018/10/18
 */
layui.define(['form', 'layedit', 'laydate'], function (exports) {
    var $ = layui.$;
    var form = layui.form;
    var layer = layui.layer;
    var layedit = layui.layedit;
    var laydate = layui.laydate;

    form.render(null, "zmn-form");

    // 提交
    form.on('submit(zmn-form-submit)', function (obj) {
        var rolesStr = "";
        let roleArr = new Array();
        let roles = $('input[name="roles"]');
        for(let k in roles){
            if(roles[k].checked)
                roleArr.push(roles[k].value);
        }

        rolesStr = roleArr.join(",");

        zmnPage.ajaxSimple("/msg/conf/receive/role/save.action", {ids: rolesStr, msgId: json.msgId}, 1500);
    });

    //对外暴露的接口
    exports('msg_conf_receiverole_edit', {});
});
